package com.ybkj.daijia.server.mapper;

import com.ybkj.daijia.server.model.DriverChoseLevelFreight;
import org.apache.ibatis.annotations.Param;

public interface DriverChoseLevelFreightMapper {

    /**
     * 保存提成信息
     *
     * @param driverLevel
     * @return
     */
    int insertRecord(DriverChoseLevelFreight driverChoseLevelFreight);

    /**
     * 根据主键查询提成信息
     *
     * @param id
     * @return
     */
    DriverChoseLevelFreight selectByDriverAndDriverLevel(@Param("driverId") Long driverId,
        @Param("driverlevelId") Long driverlevelId);

    DriverChoseLevelFreight selectByPrimaryKey(@Param("driverId") Long driverId,
        @Param("driverlevelId") Long driverlevelId, @Param("companyId") Long companyId);

    DriverChoseLevelFreight selectByDriverAndCompany(@Param("driverId") Long driverId,
        @Param("companyId") Long companyId);

    /**
     * 根据主键删除提成信息
     *
     * @param id
     * @return
     */
    int deleteByDriverAndDriverLevel(@Param("driverId") Long driverId,
        @Param("driverlevelId") Long driverlevelId);

    /**
     * 根据公司删除提成信息
     *
     * @param companyId
     * @return
     */
    int deleteByDriver(@Param("driverId") Long driverId);

    int deleteByDriverAndCompany(@Param("driverId") Long driverId,
        @Param("companyId") Long companyId);

    /**
     * 根据公司删除提成信息
     *
     * @param companyId
     * @return
     */
    int deleteByDriverLevel(@Param("driverlevelId") Long driverlevelId);

    int deleteByCompany(@Param("companyId") Long companyId);

    /**
     * 根据主键更新公司信息
     *
     * @param driverLevel
     * @return
     */
    int updateByPrimaryKey(DriverChoseLevelFreight driverChoseLevelFreight);


}
